{{ template "header"   . }}
{{ template "rankings" . }}

<main id=two-pane>
    {{ template "nav" . }}

{{ if ne .Data.LangID "all" }}
    <table class="nowrap-second sticky">
        <thead>
            <tr>
                <th>#
                <th>Hole
                <th class=right>Medal
        <tbody>
        {{ range $i, $r := .Data.Rows }}
            <tr>
                <td>{{ inc $i }}<sup>{{ $i | inc | ord }}</sup>
                <td>
                    <a href="/rankings/holes/{{ .Hole.ID }}/all/{{ $.Data.Scoring }}">
                        <span>{{ .Hole.Name }}</span>
                    </a>
                <td class=right>
                    {{ if eq .Rank 1 }}🥇{{ end }}
                    {{ if eq .Rank 2 }}🥈{{ end }}
                    {{ if eq .Rank 3 }}🥉{{ end }}
        {{ end }}
    </table>
{{ else }}
    <table class="nowrap-second sticky">
        <thead>
            <tr>
                <th>#
                <th>Language
                <th class=right colspan=3>Medals
                <th class=right>Points
                <th class=right>{{ title .Data.Scoring }}
        <tbody>
        {{ range .Data.Rows }}
            <tr>
                <td>{{ .Rank }}<sup>{{ ord .Rank }}</sup>
                <td>
                    <a href="/rankings/langs/{{ .Lang.ID }}/{{ $.Data.Scoring }}">
                        {{ svg .Lang.ID }}
                        <span>{{ .Lang.Name }}</span>
                    </a>
                <td class=right>{{ with .Golds   }}{{ . }}🥇{{ end }}
                <td class=right>{{ with .Silvers }}{{ . }}🥈{{ end }}
                <td class=right>{{ with .Bronzes }}{{ . }}🥉{{ end }}
                <td class=right>{{ comma .Points  }}
                <td class=right>{{ comma .Strokes }}
        {{ end }}
    </table>
{{ end }}
</main>

{{ template "footer" }}
